#pragma once

#include "HTMLDrawer.h"
#include "HTMLFont.h"

// CSimpleHtmlStatic

class CSimpleHtmlStatic : public CStatic
{
	DECLARE_DYNAMIC(CSimpleHtmlStatic)

public:
	CSimpleHtmlStatic();
	virtual ~CSimpleHtmlStatic();
protected:
	COLORREF	m_rgbBackground;
	COLORREF	m_rgbHighlight;
	bool		m_isUnderlineWhenHighlight;

	bool		m_isTextPrepared;
	CHTMLDrawer m_htmlDrawer;
	CHTMLFont	m_Font;
	CString		m_strScript;

public:
	void SetScript(LPCTSTR strScript)
	{
		m_strScript = strScript;
		m_isTextPrepared = false;
		Invalidate(true);
	}

	const CHTMLFont & GetFont() const
	{
		return m_Font;
	}
	void  SetFont(const CHTMLFont & Font)
	{
		m_isTextPrepared = false;
		m_Font = Font;
		Invalidate(true);
	}
	//
	const CString& GetScript() const 
	{
		return m_strScript;
	}
	//
	COLORREF GetBackgroundColour() const 
	{
		return m_rgbBackground;
	}
	void SetBackgroundColour(COLORREF nBackground)
	{
		m_rgbBackground = nBackground;
	}
	//
	COLORREF GetHighlightColour() const 
	{
		return m_rgbHighlight;
	}
	void SetHighlightColour(COLORREF nHighlight)
	{
		m_rgbHighlight = nHighlight;
	}
	//
	bool IsUnderlineWhenHighlight() const 
	{
		return m_isUnderlineWhenHighlight;
	}
	void SetUnderlineWhenHighlight(bool isUnderlineWhenHighlight)
	{
		m_isUnderlineWhenHighlight = isUnderlineWhenHighlight;
	}

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
};


